finding the least common denominator (lcd or lcm) [fbt]